var mm_subMenus = new Array();
var query = location.search.substr(1);
var defMenuIndex = parseInt(query.split("/")[0]) || 0;
var defSubMenuIndex = parseInt(query.split("/")[1]) || 0;
function addMM_Array(a){
	for( var i=0; i < a.length; i++ )
		a[i].push(mm_subMenus.length-1);
	mm_subMenus.push(a);
}
addMM_Array(
		new Array(new Array("","Corporate Highlights","navigateToSubMenu('0/0')"),
							new Array("","Company History",""),
							new Array("","Executive Summary","navigateToSubMenu('0/2')")
						)
);
addMM_Array(
	new Array( new Array("","Dealer Signup","navigateToSubMenu('1/0')")
						,new Array("AGREEMENT_F","Dealer Agreement","open('/data/docs/dealers/Franchise/DealerAgreement_F.htm','AGREEMENT','toolbar=0,menubar=0,status=0,scrollbars=1,resizable=1')")
						//,new Array("GL_Franchise","Guidelines By State","navigateToSubMenu('1/2')")
					 )
);
addMM_Array(
	new Array(new Array("","Dealer Signup","navigateToSubMenu('2/0')")
						,new Array("AGREEMENT_I","Dealer Agreement","open('/data/docs/dealers/Independent/DealerAgreement_I.htm','AGREEMENT','toolbar=0,menubar=0,status=0,scrollbars=1,resizable=1')")
						//,new Array("GL_Independent","Guidelines by State","navigateToSubMenu('2/2')")
					 )
);
addMM_Array(
	new Array(new Array("mainList","Check Status of Deal","navigateToSubMenu('3/0')"),
						new Array("newDeal","Instant Call Back","navigate('/Manager/application/Application.aspx')"),
						new Array("bookACar","Book a Car","navigateToSubMenu('3/2')")
					 )
);
addMM_Array(
	new Array(//new Array("BK_SPECIAL","Summer Special","navigateToSubMenu('4/0')"),
						new Array("BK_MAILER","BK Mailer","navigateToSubMenu('4/0')"),
						new Array("Beacon_Mailer","Beacon Mailer","navigateToSubMenu('4/1')"),
						new Array("","Name Leads",""),
						new Array("","Referral Program","")
					 )
);
addMM_Array(
	new Array(new Array("","New Company","navigate('NewCompany.htm')"),
						new Array("","Check Account Balance",""),
						new Array("","Check Account History","")
					 )
);
addMM_Array(
	new Array(new Array("","Application","navigate('/manager/menu/')"),
						new Array("","Help","navigate('/assist.htm')"),
						new Array("","Book Out","")
					 )
);
function findSubMenuItem(itemName){
	for( var i=0; i < mm_subMenus.length; i++ )
		for( var j=0; j < mm_subMenus[i].length; j++ )
			if( itemName == mm_subMenus[i][j][0] )return mm_subMenus[i][j];
	alert("No SubMenuItem found for " + itemName);
}
var SM_LABEL = 1;
var SM_ONCLICK = 2;
var SM_INDEX = 3;
function runSubMenuItem(subMenuItemName){
	var subMenuItem = findSubMenuItem(subMenuItemName);
	var foo = subMenuItem[SM_ONCLICK];
	eval(foo);
}
var mm_menuColors = new Array("moccasin","#ffe5b6",
		"#ffe6b7","#ffe7b8","#ffe8b9","#ffe9ba","#ffeabb","#ffebbc","#ffecbd",
		"#ffedbe","#ffeebf","#ffefc0","#fff0c1","#fff1c2","#fff2c3","#fff3c4",
		"#fff4c5","#fff5c6","#fff6c7","#fff7c8","#fff8c9","#fff9ca","#fffacb",
		"#fffbcc","#fffccd","#fffdce","#fffecf","#ffffd0","#ffffd0","#ffffd1",
		"#ffffd3","#ffffd4","#ffffd5","#ffffd6","#ffffd7","#ffffd8","#ffffd9",
		"#ffffda","#ffffdb","#ffffdc","#ffffdd","#ffffde","#ffffdf","#ffffe0",
		"#ffffe1","#ffffe3","#ffffe4","#ffffe5","#ffffe6","#ffffe7","#ffffe8",
		"#ffffe9","#ffffea","#ffffeb","#ffffec","#ffffed","#ffffee","#ffffef","#fffff0"
);
function serverDocument(docName){
	lnkDoc.href = "/include/docs/"+docName;
	lnkDoc.target = "_blank";
	lnkDoc.click();
}